home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / INTERNET / SITES / LITTLE / P3SRC.ZIP / ATARI / ATMOSPH.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-27  |  5.2 KB  |  158 lines

  1. /****************************************************************************
  2. *                   atmoshp.h
  3. *
  4. *  This module contains all defines, typedefs, and prototypes for ATMOSPH.C.
  5. *
  6. *  from Persistence of Vision(tm) Ray Tracer
  7. *  Copyright 1996 Persistence of Vision Team
  8. *---------------------------------------------------------------------------
  9. *  NOTICE: This source code file is provided so that users may experiment
  10. *  with enhancements to POV-Ray and to port the software to platforms other
  11. *  than those supported by the POV-Ray Team.  There are strict rules under
  12. *  which you are permitted to use this file.  The rules are in the file
  13. *  named POVLEGAL.DOC which should be distributed with this file. If
  14. *  POVLEGAL.DOC is not available or for more info please contact the POV-Ray
  15. *  Team Coordinator by leaving a message in CompuServe's Graphics Developer's
  16. *  Forum.  The latest version of POV-Ray may be found there as well.
  17. *
  18. * This program is based on the popular DKB raytracer version 2.12.
  19. * DKBTrace was originally written by David K. Buck.
  20. * DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
  21. *
  22. *****************************************************************************/
  23.  
  24.  
  25. #ifndef ATMOSPH_H
  26. #define ATMOSPH_H
  27.  
  28. #include "warps.h"
  29.  
  30. /*****************************************************************************
  31. * Global preprocessor defines
  32. ******************************************************************************/
  33.  
  34. /* Define fog types. DMF */
  35.  
  36. #define ORIG_FOG    1
  37. #define GROUND_MIST 2
  38. #define FOG_TYPES   2
  39.  
  40. /* Atmospheric scattering types. [DB 11/94] */
  41.  
  42. #define ISOTROPIC_SCATTERING            1
  43. #define MIE_HAZY_SCATTERING             2
  44. #define MIE_MURKY_SCATTERING            3
  45. #define RAYLEIGH_SCATTERING             4
  46. #define HENYEY_GREENSTEIN_SCATTERING    5
  47. #define SCATTERING_TYPES                5
  48.  
  49.  
  50. /*****************************************************************************
  51. * Global typedefs
  52. ******************************************************************************/
  53.  
  54. typedef struct Atmosphere_Struct ATMOSPHERE;
  55. typedef struct Fog_Struct FOG;
  56. typedef struct Rainbow_Struct RAINBOW;
  57. typedef struct Skysphere_Struct SKYSPHERE;
  58.  
  59. /* Atmosphere structure. [DB 11/94] */
  60.  
  61. struct Atmosphere_Struct
  62. {
  63.   int Type;               /* Scattering type                              */
  64.   int Samples;            /* Number of samples to take                    */
  65.   DBL Distance;           /* Attenuation distance for exponential falloff */
  66.   DBL Distance_Threshold; /* Min. allowed attenuation                     */
  67.   DBL Scattering;         /* Amount of scattering (lighten/darken)        */
  68.   DBL Eccentricity;       /* Exponent of the Henyey-Greenstein function   */
  69.   COLOUR Colour;          /* Color of atmosphere                          */
  70.   int AA_Level;           /* Max. aa-subdivision level                    */
  71.   DBL AA_Threshold;       /* Threshold for supersampling                  */
  72.   DBL Jitter;             /* Amount of jittering                          */
  73. };
  74.  
  75.  
  76.  
  77. struct Fog_Struct
  78. {
  79.   int Type;
  80.   DBL Distance;
  81.   DBL Alt;
  82.   DBL Offset;
  83.   COLOUR Colour;
  84.   VECTOR Up;
  85.   TURB *Turb;
  86.   SNGL Turb_Depth;
  87.   FOG *Next;
  88. };
  89.  
  90.  
  91.  
  92. /* Rainbow structure. [DB 8/94] */
  93.  
  94. struct Rainbow_Struct
  95. {
  96.   DBL Distance;
  97.   DBL Jitter;
  98.   DBL Angle, Width;
  99.   DBL Arc_Angle, Falloff_Angle, Falloff_Width;
  100.   VECTOR Antisolar_Vector;
  101.   VECTOR Up_Vector, Right_Vector;
  102.   PIGMENT *Pigment;
  103.   RAINBOW *Next;
  104. };
  105.  
  106.  
  107.  
  108. /* Skysphere structure. [DB 8/94] */
  109.  
  110. struct Skysphere_Struct
  111. {
  112.   int Count;           /* Number of pigments.       */
  113.   PIGMENT **Pigments;  /* Pigment(s) to use.        */
  114.   TRANSFORM *Trans;    /* Skysphere transformation. */
  115. };
  116.  
  117.  
  118.  
  119. /*****************************************************************************
  120. * Global variables
  121. ******************************************************************************/
  122.  
  123.  
  124.  
  125. /*****************************************************************************
  126. * Global functions
  127. ******************************************************************************/
  128.  
  129. void Initialize_Atmosphere_Code PARAMS((void));
  130. void Deinitialize_Atmosphere_Code PARAMS((void));
  131.  
  132. void Do_Infinite_Atmosphere PARAMS((RAY *Ray, COLOUR Colour));
  133. void Do_Finite_Atmosphere PARAMS((RAY *Ray, INTERSECTION *Intersection, COLOUR Colour, int Light_Source_Flag));
  134.  
  135. ATMOSPHERE *Create_Atmosphere PARAMS((void));
  136. void *Copy_Atmosphere PARAMS((ATMOSPHERE *Atmosphere));
  137. void Destroy_Atmosphere PARAMS((ATMOSPHERE *Atmosphere));
  138.  
  139. FOG *Create_Fog PARAMS((void));
  140. void *Copy_Fog PARAMS((FOG *Fog));
  141. void Destroy_Fog PARAMS((FOG *Fog));
  142.  
  143. RAINBOW *Create_Rainbow PARAMS((void));
  144. void *Copy_Rainbow PARAMS((RAINBOW *Rainbow));
  145. void Destroy_Rainbow PARAMS((RAINBOW *Rainbow));
  146.  
  147. SKYSPHERE *Create_Skysphere PARAMS((void));
  148. void *Copy_Skysphere PARAMS((SKYSPHERE *Skysphere));
  149. void Destroy_Skysphere PARAMS((SKYSPHERE *Skysphere));
  150. void Scale_Skysphere PARAMS((SKYSPHERE *Skysphere, VECTOR Vector));
  151. void Rotate_Skysphere PARAMS((SKYSPHERE *Skysphere, VECTOR Vector));
  152. void Translate_Skysphere PARAMS((SKYSPHERE *Skysphere, VECTOR Vector));
  153. void Transform_Skysphere PARAMS((SKYSPHERE *Skysphere, TRANSFORM *Trans));
  154.  
  155.  
  156.  
  157. #endif
  158.